import pytest

from app_test.page.app import App
from utils.utils import Utils
from app_test.page.login.login_page import LoginPage

# init app, create session with desire_caps, server url.
@pytest.fixture(name="app", scope="session", autouse=True)
def init_app():
    print('\napp setup_class!!!')
    app = App()
    app.start()
    yield app
    app.stop()
    # app.
# init login, get the tokens, use for multi users post
@pytest.fixture(name="login", scope="session", autouse=True)
def init_login():
    login = LoginPage()
    yield login

#1 启动appium server和模拟器
#2 启动uiautomator2
if __name__ == '__main__':
    Utils.connect()